import React, {Component} from 'react';
import { withRouter, RouteComponentProps} from 'react-router-dom'
import logoLarge from '../../static/image/logo_large.png'
import logoSmall from '../../static/image/logo_small.png'

interface IProps extends RouteComponentProps{
    collapsed: boolean
}

interface IState {

}

class index  extends Component<IProps,IState> {
    constructor(props:IProps) {
        super(props);
        this.state = {}
    }

    handleResetPage = () => {
        this.props.history.replace('/');
    }
    public render() {
        return (
            <>
                <div className="logo_logo">
                    <h1 onClick={ this.handleResetPage} style={{ cursor: 'pointer'}}>
                        <img src={this.props.collapsed? logoSmall: logoLarge} alt="logo"/>
                    </h1>
                </div>
            </>
        );
    }
}

export default withRouter(index) ;
